package old_go_learn

import "fmt"

type Person struct {
	name string
	age int
}

func (person Person) getNameAndAge() (string,int){
	return person.name,person.age
}

type Student struct {
	Person
	speciality string
}

func (student Student) getSpeciality() string{
	return student.speciality
}

func main(){
	stu := new(Student)
	stu.name = "zhangsan"
	stu.age = 18

	name,age := stu.Person.getNameAndAge()
	fmt.Println(name,age)

	stu.speciality = "呵呵"
	fmt.Println(stu.getSpeciality())
}
